const multer = require('multer');
const { uploadFile, batchUploadFile } = require('../manageFile/upload')
const { accessResource, exportExcel } = require('../manageFile/access')
const uploads = multer({ dest: 'public/uploads/' })
// 接口配置
const fileConfig = [
	{
		//文件上传
		type: 'post',
		checkToken: true,
		params: ['/uploadFile', uploadFile],
	},
	{
		//批量文件上传
		type: 'post',
		checkToken: true,
		params: ['/batchUploadFile', uploads.single('file'), batchUploadFile],
	},
	{
		//资源访问
		type: 'get',
		checkToken: false,
		params: ['/resource/*', accessResource],
	},
	{
		//导出Excel
		type: 'post',
		checkToken: true,
		params: ['/exportExcel', exportExcel],
	}
]

module.exports = fileConfig
